package com.bdqn.dao;

import com.bdqn.pojo.User;
import org.apache.log4j.Logger;

/**
 * UserDaoOracleImpl
 *
 * @author LILIBO
 * @since 2021-10-16
 */
public class UserDaoOracleImpl implements UserDao {

    private Logger logger = Logger.getLogger(UserDaoOracleImpl.class);

    /**
     * 数据库连接字符串
     */
    private String url = null;

    public String getUrl() {
        return url;
    }

    /**
     * Spring 注入时调用的是属性的setUrl()方法，规则：setUrl --> url
     *
     * @param url
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * 保存数据
     *
     * @param user
     * @return
     */
    @Override
    public boolean save(User user) {
        logger.debug("通过连接字符串：" + this.getUrl() + " 连接到[Oracle]数据库，数据保存成功：" + user.toString());
        return true;
    }

    /**
     * 修改数据
     *
     * @param user
     * @return
     */
    @Override
    public boolean update(User user) {
        logger.debug("通过连接字符串：" + this.getUrl() + " 连接到[Oracle]数据库，数据修改成功：" + user.toString());
        return true;
    }

    /**
     * 删除数据
     *
     * @param user
     * @return
     */
    @Override
    public boolean delete(User user) {
        logger.debug("通过连接字符串：" + this.getUrl() + " 连接到[Oracle]数据库，数据删除成功：" + user.toString());
        return true;
    }

}
